package cn.tom.dao;

import cn.tom.entity.Largefile;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface LargeFileDao {
    /*private String id;  // 文件数据
   private String filename;  //文件名字
   private Object content;  //文件内容*/
    @Insert( "insert into t_largefile" +
            "(id,filename,content)" +
            "value(#{id},#{filename}," +
            "#{content,javaType=byte[], jdbcType=BLOB,typeHandler=org.apache.ibatis.type.BlobTypeHandler})")
    public void add(Largefile largefile);
    @Select(value = "select id,filename,content from t_largefile where id=#{id}")
    public Largefile findOne(String id);
    /*先删除后插入*/
    @Delete(value = "delete from t_largefile where id=#{id}")
    void delete(String id);
}
